Repository navigation
fix: Support half-close on native transport hijacked streams - #133
Merged
Merged
Conversation
HofmeisterAn
force-pushed
the
bugfix/native-half-close
branch
from
October 31, 2026 17:27
1112807 to
e098351
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
CloseWriteon a hijacked stream (attach, exec) of the native transport closed the whole stream instead of only its write side, so reading the output after closing stdin failed with "Stream does not support reading".Because the upgraded stream from
SocketsHttpHandlerdoesn't expose its socket,DockerClientnow begins aHijackScope, a new public type inDocker.DotNet.Handler.Abstractions, around hijack requests.The native transport now connects through its own connect callbacks for Unix sockets and TCP, and their stream records the socket the hijack request is written to, so
CloseWriteshuts down only that socket's send side, as the legacy transports do.Recording starts only once a connection is fully set up, so writes from a TLS handshake that runs on behalf of a request sent over another connection are ignored.
If a user replaces the connect callback or plaintext stream filter through
ConfigureHandler,CloseWritekeeps its previous behavior.